<template>
  <div>
      <div style="display:inline-block" v-for="item in arr" :key="item">
 <input type="checkbox" v-model="num" :value="item"> 
 <span>{{item}}</span>
      </div>
         
      <p>你选中的数字累加的和为:{{total}}</p>

  </div>
</template>

<script>
export default {
    computed:{
        total(){
return this.num.reduce((accu,val) => accu+val)
        }
    },
data(){
    return{
        arr:[9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
        num:[]
    }
}
}
</script>

<style>

</style>